import React, { useState, useEffect } from 'react';
import ReactDOM from 'react-dom';
import { Bar } from '@ant-design/plots';

const DemoBar = () => {
  const data = [
    {
      year: '张三',
      value: 36,
    },
    {
      year: '李四',
      value: 24,
    },
    {
      year: '王五',
      value: 13,
    },
    {
      year: '老师一',
      value: 9,
    },
    {
      year: '老师二',
      value: 6,
    },
  ];
  const config = {
    data,
    xField: 'value',
    yField: 'year',
    seriesField: 'year',
    legend: false,
    style: {
      height: 55,
    },
    xAxis: false,
    yAxis: false,
  };
  return <Bar {...config} />;
};

export default DemoBar;
